<?php
/**
 * Created by PhpStorm.
 * User: 刘海平（785313152）
 * Date: 2019/3/29
 * Time: 10:22
 * Message: 对未来没概念，也不想有概念，脑子里只关心汤面会不会太咸！
 */

namespace app\index\controller;


use app\common\controller\IndexBase;
use app\common\model\Share;
use app\index\model\Ads;
use app\index\model\Topic;
use think\Session;

class Index extends IndexBase
{
    protected function _initialize()
    {
        parent::_initialize();
    }

    public function index(){
        $banner = model('Ads')->where('nid=1')->select();
        $this->assign('banner',$banner);
        $topic = new Topic();
        $topic_list = $topic->order('add_time desc')->limit(3)->select();
        $this->assign('topic_list',$topic_list);
        $jdz = new \app\admin\model\Jdz();
        $jdz_list = $jdz->order('add_time desc')->limit(3)->select();
        $this->assign('jdz_list',$jdz_list);
        $share = new Share();
        $share_list = $share->where(['is_show'=>1])->order('add_time desc')->limit(3)->select();
        $this->assign('share_list',$share_list);
        return $this->fetch();
    }

    public function get_user_info(){
        $this->assign('index','231');
    }
}